cmake_minimum_required(VERSION 2.8)
project( PR_DETECTION )

set(CMAKE_CXX_STANDARD 11)
set (OpenCV_DIR "/home/yjy/Software/opencv-2.4.13.6/build")

find_package( OpenCV REQUIRED )
find_package(edcc REQUIRED)

set (work_dir "/home/yjy/VSCodeProjects/palmMatch/")
set (source_dir "src/")
set (test_dir "test/")
set (include_dir "headers/")
set (lib_dir "libs/")
set (source_ext ".cpp")
set (target_ext ".app")

set(CMAKE_BUILD_TYPE Debug CACHE STRING "set build type to Debug")
set(CMAKE_CXX_FLAGS "-g ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "-g ${CMAKE_C_FLAGS}")

include_directories(${include_dir})
include_directories(${EDCC_INCLUDE_DIR})
#add_subdirectory(include)

#set(file_names "main" )

#-----------------------target for app--------------------------
add_executable( main.app
${source_dir}Dataset.cpp
${source_dir}util.cpp
${source_dir}ObjectDetector.cpp
${source_dir}ZhangsFingerRootsDetector.cpp
${source_dir}YangsFingerRootsDetector.cpp
${source_dir}palmdll.cpp
${source_dir}app/main.cpp
)
add_executable( mean_palm_generator.app
${source_dir}app/generate_mean_palm.cpp
)
add_executable( check_success_rate.app
    ${source_dir}app/checkSuccessRate.cpp
    ${source_dir}palmdll.cpp
)
add_executable( theta_estimate.app
    ${source_dir}app/theta_estimate.cpp
    ${source_dir}palmdll.cpp
)
add_executable( generate_segment_label.app
    ${source_dir}app/generate_segment_label.cpp
)
add_library( featureExtractor SHARED
    ${source_dir}app/featureExtractor.cpp
    ${source_dir}palmdll.cpp
)
add_library( zhangROI SHARED
    ${source_dir}app/ZhangROIExtract.cpp
    ${source_dir}palmdll.cpp
)

#-----------------------target for test--------------------------
add_executable( testZhangROIExtract.app
	${source_dir}app/ZhangROIExtract.cpp
	${source_dir}palmdll.cpp
	${test_dir}testZhangROIExtract.cpp
	)

#msvcrt
ADD_DEPENDENCIES( main.app ${EDCC_LIBRARIES})
target_link_libraries(  main.app  ${EDCC_LIBRARIES})
target_link_libraries( main.app ${OpenCV_LIBS})

target_link_libraries( mean_palm_generator.app ${OpenCV_LIBS})
target_link_libraries( check_success_rate.app ${OpenCV_LIBS})
target_link_libraries( theta_estimate.app ${OpenCV_LIBS})
target_link_libraries( generate_segment_label.app ${OpenCV_LIBS})
target_link_libraries( featureExtractor ${OpenCV_LIBS})
target_link_libraries( zhangROI ${OpenCV_LIBS})
target_link_libraries( testZhangROIExtract.app ${OpenCV_LIBS})
#target_link_libraries( main.app ${work_dir}${lib_dir}libZhangs_fincon_detect.a ${work_dir}${lib_dir}libZhangs_ancient_code.a)
